refactor: rename reference checker names#244
Conversation
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the reference checker naming scheme to improve organization and clarity. The checkers are reorganized into three thematic groups: record-to-record references (A to B), same-record references (A to A'), and file references, with IDs renumbered accordingly (REF013-021 → REF101-106, REF201-203).
Key changes:
- Reorganized documentation into three clear reference checker categories
- Renamed checker classes and files from REF013-021 to REF101-106 and REF201-203
- Updated all imports and test references to use new identifiers
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/schema/requirement.md | Restructured reference requirements into three themed sections with updated IDs |
| t4_devkit/sanity/reference/init.py | Updated imports to reflect renamed checker modules |
| t4_devkit/sanity/reference/ref101.py | Renamed REF016 → REF101 (Sample.next checker) |
| t4_devkit/sanity/reference/ref102.py | Renamed REF017 → REF102 (Sample.prev checker) |
| t4_devkit/sanity/reference/ref103.py | Renamed REF018 → REF103 (SampleAnnotation.next checker) |
| t4_devkit/sanity/reference/ref104.py | Renamed REF019 → REF104 (SampleAnnotation.prev checker) |
| t4_devkit/sanity/reference/ref105.py | Renamed REF020 → REF105 (SampleData.next checker) |
| t4_devkit/sanity/reference/ref106.py | Renamed REF021 → REF106 (SampleData.prev checker) |
| t4_devkit/sanity/reference/ref201.py | Renamed REF013 → REF201 (SampleData.filename checker) |
| t4_devkit/sanity/reference/ref202.py | Renamed REF014 → REF202 (SampleData.info_filename checker) |
| t4_devkit/sanity/reference/ref203.py | Renamed REF015 → REF203 (LidarSeg.filename checker) |
| tests/sanity/test_reference_checkers.py | Updated test imports and test function names to match new checker IDs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| id = RuleID("REF014") | ||
| id = RuleID("REF202") | ||
| name = RuleName("sample-data-filename-presence") |
There was a problem hiding this comment.
The name field 'sample-data-filename-presence' is inconsistent with the description and actual functionality. This checker validates 'info_filename', not 'filename'. The name should be 'sample-data-info-filename-presence' to match the documentation and checker ID REF202.
| name = RuleName("sample-data-filename-presence") | |
| name = RuleName("sample-data-info-filename-presence") |
| """Mutate sample_data.json to point to a missing file for REF013.""" | ||
| def test_ref201_fail_missing_filename(tmp_path: Path) -> None: | ||
| """Mutate sample_data.json to point to a missing file for REF201.""" | ||
| root = _copy_dataset(tmp_path / "dataset_ref013_fail") |
There was a problem hiding this comment.
The directory name 'dataset_ref013_fail' should be updated to 'dataset_ref201_fail' to match the renamed checker REF201.
| root = _copy_dataset(tmp_path / "dataset_ref013_fail") | |
| root = _copy_dataset(tmp_path / "dataset_ref201_fail") |
| """Add an info_filename pointing to a non-existing file to trigger REF014 failure.""" | ||
| def test_ref202_fail_missing_info_filename(tmp_path: Path) -> None: | ||
| """Add an info_filename pointing to a non-existing file to trigger REF202 failure.""" | ||
| root = _copy_dataset(tmp_path / "dataset_ref014_fail") |
There was a problem hiding this comment.
The directory name 'dataset_ref014_fail' should be updated to 'dataset_ref202_fail' to match the renamed checker REF202.
| root = _copy_dataset(tmp_path / "dataset_ref014_fail") | |
| root = _copy_dataset(tmp_path / "dataset_ref202_fail") |
What
This pull request reorganizes and refactors the reference checkers in the codebase to improve clarity and maintainability. The main changes include splitting the requirements in the documentation into clearer thematic groups, renaming and reassigning reference checker classes and files to match the new grouping, and updating imports and tests to use the new identifiers.
Documentation and requirement grouping:
docs/schema/requirement.mdfile now separates reference requirements into three groups: "Record Reference (A to B)", "Record Reference (A to A')", and "File Reference", with updated IDs and descriptions for each requirement. [1] [2]Codebase refactor and renaming:
REF016→REF101,REF013→REF201) and split into thematic groups. The corresponding__init__.pyimports have been updated. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Test updates:
tests/sanity/test_reference_checkers.pyhave been updated to use the new identifiers and imports, including parameterized tests and individual test cases. [1] [2] [3] [4] [5]